package com.bawei.module_home.mvp;

import com.bawei.library_base.manager.MyManager;
import com.bawei.library_base.mvvm.BaseModel;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * @author : zhiyu
 * @date : 2021/12/13
 * @content :
 */
public class GoodsModel extends BaseModel implements GoodsContract.GoodsModel {
    @Override
    public void initModel(Observer<Goods> observer,String keyword,String type,int pageno,int pagesize) {
        MyManager.getInstance().getRetrofit("http://82.156.178.182:8082")

                .create(Api.class)
                .getGood(keyword, type,pageno,pagesize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(observer);
    }
}
